package com.valeandre.euroro.model;

import java.util.ArrayList;
import java.util.List;

import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.Root;

@Root(name="prices")
public class Prices {

	@ElementList (inline = true, required = false)
	private List<Currency> currencies= new ArrayList<Currency>();

	public List<Currency> getCurrencies() {
		return currencies;
	}

	public void setCurrencies(List<Currency> currencies) {
		this.currencies = currencies;
	}
	
	public Currency getCurrency(String currency) {
		Currency ret = null;
		if (currencies != null && currencies.size() > 0) {
			for (Currency curr : currencies) {
				if (curr.getAccess().equals(currency)) {
					ret = curr;
				}
			}
		}
		return ret;
	}
	
	
}
